#include "read_only_env.h"
#include "include/leveldb/db.h"
#include "include/leveldb/options.h"

#include <iostream>

int main(int argc, char* argv[]) {
leveldb::Options options;
options.env = new leveldb::ReadOnlyEnv();  // Set the custom environment

leveldb::DB* db;
leveldb::Status status = leveldb::DB::Open(options, "./db", &db);

if (!status.ok()) {
    // Handle error
    std::cout << "open db failed with: " << status.ToString() << std::endl;
    return 1;
}

std::cout << "open db success" << std::endl;


// Perform read operations here...

delete db;
delete options.env;  // Clean up the custom environment
}
